#if !defined(ximera_graphics_ogre_entity_hpp)
#define ximera_graphics_ogre_entity_hpp

// -----------------------------------------------------------

#include <ximera/graphics/ientity.hpp>
#include <ximera/graphics/ogre/iattachable.hpp>
#include <ximera/graphics/iworld.hpp>

#include <OgreSceneManager.h>
#include <OgreEntity.h>

namespace ximera { namespace graphics { namespace ogre
{
    class XIMERA_PLUGIN_API Entity : public IEntity, public IAttachable
    {
    public:
        Entity(Ogre::SceneManager* ogreSceneManager, String const& name, PrefabEntityType type);
        Entity(Ogre::SceneManager* ogreSceneManager, String const& name, String const& meshName);
        Entity(Ogre::SceneManager* ogreSceneManager, Ogre::Entity* ogreEntity);
        virtual ~Entity();

        virtual bool visible() const;
        virtual void visible(bool vis);

        virtual String materialName() const;
        virtual void materialName(String const& name);

        virtual void descendantMaterial(String const& name, String const& material);

        virtual bool castShadows() const;
        virtual void castShadows(bool casts);

        virtual void enableAnimation(String const& name, bool enable = true);
        virtual void step(String const& animName, Real secs);
        virtual void step(Real secs);

        virtual void attach(String const& boneName, Attachable* object);

        virtual void useCameraRenderMode(bool value);

        virtual Ogre::MovableObject* ogreMovableObject() const { return _ogreEntity; }

    private:
        Ogre::Entity* _ogreEntity;
        Ogre::SceneManager* _ogreSceneManager;
    };
}}}

// -----------------------------------------------------------

#endif